/*
 * Copyright 2018 The JA-SIG Collaborative. All rights reserved.
 * distributed with thi file and available online at
 */
package com.lap.scp.erp.ao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.lap.scd.commons.ao.AbstractAO;
import com.lap.scd.commons.constant.RespCode;
import com.lap.scd.commons.page.Page;
import com.lap.scd.commons.page.PageResult;
import com.lap.scd.commons.page.PageUtils;
import com.lap.scp.erp.ao.SalaryAO;
import com.lap.scp.erp.core.PaymentManager;
import com.lap.scp.erp.domain.ArtificialDO;
import com.lap.scp.erp.query.PaymentQueryVO;

/**
 * <pre>
 *
 * </pre>
 * 
 * @author 劳水生 Exp
 * @Date 2018年10月13日 下午5:28:03
 * @since 1.0
 */
@Service("salaryAO")
public class DefaultSalaryAO extends AbstractAO implements SalaryAO {
	/**
	 * 其他成本业务操作对象
	 */
	@Resource
	private PaymentManager paymentManager;

	@Override
	public PageResult<ArtificialDO> queryPage(Page page, PaymentQueryVO queryVO) {
		PageResult<ArtificialDO> pr = new PageResult<>();
		try {
			List<ArtificialDO> list = paymentManager.querySalaryPage(page, queryVO);

			PageUtils.copyPage(pr, page);
			pr.setData(list);
		} catch (Exception e) {
			pr.putMsg(RespCode.Error, super.getMsg("505", new String[] { e.getLocalizedMessage() }));
			super.writeLog(new Object[] { page, queryVO }, e);
		}
		return pr;
	}

}
